﻿<?php $this->load->view('admin/_header1') ?>
<link rel="stylesheet" type="text/css" href="'<?=site_url('css/validator.css');?>'" />
<script language="javascript" type="text/javascript" src="<?php echo site_url('js/formValidator_min.js')?>"></script>
<script language="javascript" type="text/javascript" src="<?php echo site_url('js/formValidatorRegex.js')?>"></script>
<div class="Main">
	<?php
	echo $title;
	echo form_open("admin/setting/dosavecurrency",array("id" => "formset"))
	?>
	<table cellpadding=5px border=0 cellspacing=5 >
		<tr height=25 >
			<td>Using currency: </td>
			<td>China Domestic: </td>
			<td>International: </td>
		</tr>
		<tr height=25 >
			<td><?
			$data = array(
			    'name'        => 'currency',
			    'id'          => 'txcurrency1',
			    'value'       => 'RMB',
			    'checked'     => set_radio('currency', 'RMB', $MainCurrency=="RMB") 
			    );
			echo form_radio($data);
			echo form_label("RMB",'txcurrency1');
			echo form_hidden("CurrencyRate_RMB","1");
			?></td>
			<td></td>
			<td><span style="width:55px">RMB = </span><?php
				
				if($MainCurrency=="RMB")
				{
					$CurrentValue=$CurrencyRate2;
				}else
				{
					$CurrentValue="";
				}
				
				$data = array(
		              'name'        => 'CurrencyRate2_RMB',
		              'id'          => 'txCurrencyRate07',
		              'value'       => $CurrentValue,
		              'class'        => 'txa'
		            );

				echo form_input($data)
			?> : 1</td>
		</tr>
		
		<tr height=25 >
			<td><?
			$data = array(
			    'name'        => 'currency',
			    'id'          => 'txcurrency2',
			    'value'       => 'HKD',
			    'checked'     => set_radio('currency', 'HKD',$MainCurrency=="HKD") 
			    );
			echo form_radio($data);
			echo form_label("HKD",'txcurrency2');
			
			?></td>
			<td>RMB = <?php
				if($MainCurrency=="HKD")
				{
					$CurrentValue=$CurrencyRate;
				}else
				{
					$CurrentValue="";
				}
				$data = array(
		              'name'        => 'CurrencyRate_HKD',
		              'id'          => 'txCurrencyRate2',
		              'value'       => $CurrentValue,
		              'class'        => 'txa'
		            );

				echo form_input($data)
			?> : 1</td>
			<td><span style="width:55px">HKD = </span><?php
				if($MainCurrency=="HKD")
				{
					$CurrentValue=$CurrencyRate2;
				}else
				{
					$CurrentValue="";
				}
				$data = array(
		              'name'        => 'CurrencyRate2_HKD',
		              'id'          => 'txCurrencyRate02',
		              'value'       => $CurrentValue,
		              'class'        => 'txa'
		            );

				echo form_input($data)
			?> : 1</td>
			<td><div id="txCurrencyRate2Tip"></div></td>
		</tr>
		
		<tr height=25 >
			<td><?
			$data = array(
			    'name'        => 'currency',
			    'id'          => 'txcurrency3',
			    'value'       => 'MOP',
			    'checked'     => set_radio('currency', 'MOP',$MainCurrency=="MOP") 
			    );
			echo form_radio($data);
			echo form_label("MOP",'txcurrency3');
			
			?></td>
			<td>RMB = <?php
				
				if($MainCurrency=="MOP")
				{
					$CurrentValue=$CurrencyRate;
				}else
				{
					$CurrentValue="";
				}
				
				$data = array(
		              'name'        => 'CurrencyRate_MOP',
		              'id'          => 'txCurrencyRate3',
		              'value'       => $CurrentValue,
		              'class'        => 'txa'
		            );

				echo form_input($data)
			?> : 1</td>
			
			<td><span style="width:55px">MOP = </span><?php
				
				if($MainCurrency=="MOP")
				{
					$CurrentValue=$CurrencyRate2;
				}else
				{
					$CurrentValue="";
				}
				
				$data = array(
		              'name'        => 'CurrencyRate2_MOP',
		              'id'          => 'txCurrencyRate03',
		              'value'       => $CurrentValue,
		              'class'        => 'txa'
		            );

				echo form_input($data)
			?> : 1</td>
			
			<td><div id="txCurrencyRate3Tip"></div></td>
		</tr>
		
		<tr height=25 >
			<td><?
			$data = array(
			    'name'        => 'currency',
			    'id'          => 'txcurrency6',
			    'value'       => 'TWD',
			    'checked'     => set_radio('currency', 'TWD',$MainCurrency=="TWD") 
			    );
			echo form_radio($data);
			echo form_label("TWD",'txcurrency6');
			
			?></td>
			<td>RMB = <?php
				
				if($MainCurrency=="TWD")
				{
					$CurrentValue=$CurrencyRate;
				}else
				{
					$CurrentValue="";
				}
				
				$data = array(
		              'name'        => 'CurrencyRate_TWD',
		              'id'          => 'txCurrencyRate6',
		              'value'       => $CurrentValue,
		              'class'        => 'txa'
		            );

				echo form_input($data)
			?> : 1</td>
			
			<td><span style="width:55px">TWD = </span><?php
				
				if($MainCurrency=="TWD")
				{
					$CurrentValue=$CurrencyRate2;
				}else
				{
					$CurrentValue="";
				}
				
				$data = array(
		              'name'        => 'CurrencyRate2_TWD',
		              'id'          => 'txCurrencyRate06',
		              'value'       => $CurrentValue,
		              'class'        => 'txa'
		            );

				echo form_input($data)
			?> : 1</td>
			
			<td><div id="txCurrencyRate6Tip"></div></td>
		</tr>
		
		<tr height=25 >
			<td><?
			$data = array(
			    'name'        => 'currency',
			    'id'          => 'txcurrency4',
			    'value'       => 'USD',
			    'checked'     => set_radio('currency', 'USD',$MainCurrency=="USD") 
			    );
			echo form_radio($data);
			echo form_label("USD",'txcurrency4');
			
			?></td>
			<td>RMB = <?php
				
				if($MainCurrency=="USD")
				{
					$CurrentValue=$CurrencyRate;
				}else
				{
					$CurrentValue="";
				}
				
				$data = array(
		              'name'        => 'CurrencyRate_USD',
		              'id'          => 'txCurrencyRate4',
		              'value'       => $CurrentValue,
		              'class'        => 'txa'
		            );

				echo form_input($data)
			?> : 1</td>
			
			<td><span style="width:55px">USD = </span><?php
				
				if($MainCurrency=="USD")
				{
					$CurrentValue=$CurrencyRate2;
				}else
				{
					$CurrentValue="";
				}
				
				$data = array(
		              'name'        => 'CurrencyRate2_USD',
		              'id'          => 'txCurrencyRate04',
		              'value'       => $CurrentValue,
		              'class'        => 'txa'
		            );

				echo form_input($data)
			?> : 1</td>
			<td><div id="txCurrencyRate4Tip"></div></td>
		</tr>
		
		
		
		
		<tr height=25 >
			<td><?
			$blcurrency=!(strpos(",RMB,MOP,USD,HKD,TWD",$MainCurrency));
			
			$data = array(
			    'name'        => 'currency',
			    'id'          => 'txcurrency5',
			    'value'       => 'CUS',
			    'checked'     => set_radio('currency', 'CUS',$blcurrency) 
			    );
			echo form_radio($data);
			$data = array(
		              'name'        => 'Custcurrency',
		              'id'          => 'txServiceCharge5',
		              'value'       => $MainCurrency,
		              'class'        => 'txd',
		              'style'	  => 'width:40px'
		            );

			echo form_input($data)
			?></td>
			<td>RMB = <?php
				
				if($blcurrency)
				{
					$CurrentValue=$CurrencyRate;
				}else
				{
					$CurrentValue="";
				}
				
				$data = array(
		              'name'        => 'CurrencyRate_CUS',
		              'id'          => 'txCurrencyRate5',
		              'value'       => $CurrentValue,
		              'class'      => 'txa'
		            );

				echo form_input($data)
			?> : 1</td>
			
			<td><?php
				echo '<span style="width:55px">'.$MainCurrency.' = </span>';
				
				if($blcurrency)
				{
					$CurrentValue=$CurrencyRate2;
				}else
				{
					$CurrentValue="";
				}
				
				$data = array(
		              'name'        => 'CurrencyRate2_CUS',
		              'id'          => 'txCurrencyRate05',
		              'value'       => $CurrentValue,
		              'class'      => 'txa'
		            );

				echo form_input($data)
			?> : 1</td>
			
			<td><div id="txCurrencyRate4Tip"></div></td>
		</tr>
		
		<tr height=25 >
			<td>Service change: </td>
		</tr>
		<tr height=25 >
		<td>0 - 999 add </td>
			<td><?
			$data = array(
		              'name'        => 'ServiceCharge1',
		              'id'          => 'txServiceCharge1',
		              'value'       => $ServiceCharge1,
		              'class'        => 'txa'
		            );

			echo form_input($data)
			
			?></td>
			<td><div id="txServiceCharge1Tip"></div></td>
		</tr>	
		
		<tr height=25 >
		<td>1000 - 1999 add </td>
			<td><?
			$data = array(
		              'name'        => 'ServiceCharge2',
		              'id'          => 'txServiceCharge2',
		              'value'       => $ServiceCharge2,
		              'class'        => 'txa'
		            );

			echo form_input($data)
			
			?></td>
			<td><div id="txServiceCharge2Tip"></div></td>
		</tr>	
		<tr height=25 >
		<td>2000 -3000 add </td>
			<td><?
			$data = array(
		              'name'        => 'ServiceCharge3',
		              'id'          => 'txServiceCharge3',
		              'value'       => $ServiceCharge3,
		              'class'        => 'txa'
		            );

			echo form_input($data)
			
			?></td>
			<td><div id="txServiceCharge3Tip"></div></td>
		</tr>
		
		<tr height=25 >
		<td>3000 +  add </td>
			<td><?
			$data = array(
		              'name'        => 'ServiceCharge4',
		              'id'          => 'txServiceCharge4',
		              'value'       => $ServiceCharge4,
		              'class'        => 'txa'
		            );

			echo form_input($data)
			
			?></td>
			<td><div id="txServiceCharge4Tip"></div></td>
		</tr>
		<tr height=30>
			<td></td>
			<td colspan=2 >actual price=fare(RMB)*Exchange Rate + service charge</td>
		</tr>
		
		
		<tr height=25 >
			<td>Refund Service change: </td>
		</tr>
		<tr height=25 >
		<td>0 - 999 add </td>
			<td><?
			$data = array(
		              'name'        => 'refundCharge1',
		              'id'          => 'txRefundCharge1',
		              'value'       => $refundCharge1,
		              'class'        => 'txa'
		            );

			echo form_input($data)
			
			?></td>
			<td><div id="txRefundCharge1Tip"></div></td>
		</tr>	
		
		<tr height=25 >
		<td>1000 - 1999 add </td>
			<td><?
			$data = array(
		              'name'        => 'refundCharge2',
		              'id'          => 'txRefundCharge2',
		              'value'       => $refundCharge2,
		              'class'        => 'txa'
		            );

			echo form_input($data)
			
			?></td>
			<td><div id="txRefundCharge2Tip"></div></td>
		</tr>	
		<tr height=25 >
		<td>2000 -3000 add </td>
			<td><?
			$data = array(
		              'name'        => 'refundCharge3',
		              'id'          => 'txRefundCharge3',
		              'value'       => $refundCharge3,
		              'class'        => 'txa'
		            );

			echo form_input($data)
			
			?></td>
			<td><div id="txRefundCharge3Tip"></div></td>
		</tr>
		
		<tr height=25 >
		<td>3000 +  add </td>
			<td><?
			$data = array(
		              'name'        => 'refundCharge4',
		              'id'          => 'txRefundCharge4',
		              'value'       => $refundCharge4,
		              'class'        => 'txa'
		            );

			echo form_input($data)
			
			?></td>
			<td><div id="txRefundCharge4Tip"></div></td>
		</tr>
		
		<tr height=30>
			<td></td>
			<td><input type=submit name="bbb" value="Save Setting" /></td>
			<td></td>
		</tr>
		
		<tr height=30>
			<td></td>
			<td>&nbsp;<span class="txred"><?=$message?></span></td>
			<td></td>
		</tr>
		
	</table>
	<?php
	echo form_close();
	?>
	<script language="javascript">
		$(document).ready(function(){
			$.formValidator.initConfig({formid:"formset",onerror:function(msg){alert(msg)}});
			$(".txa").formValidator({onshow:"input the number",onfocus:"please input the number",oncorrect:""}).inputValidator({min:0,type:"value",onerrormin:"",onerror:"please input the number"}).defaultPassed();		
		});
		
	</script>
</div>
<?php $this->load->view('admin/_footer1') ?>